Magnetic ranging to an AC source while rotating

ABSTRACT

A method for magnetic ranging includes rotating a downhole tool in a drilling well in sensory range of magnetic flux emanating from a target well having an AC magnetic source deployed therein. The downhole tool includes a magnetic field sensor deployed therein. The magnetic field sensor measures a magnetic field vector while rotating. The measured magnetic field vector is processed to compute at least one of a distance and a direction from a drilling well to a target well.

CROSS REFERENCE TO RELATED APPLICATIONS

None.

FIELD OF THE DISCLOSURE

Disclosed embodiments relate generally to magnetic ranging methods andmore particularly to methods for magnetic ranging while drilling (i.e.,while the drill string is rotating).

BACKGROUND INFORMATION

In subterranean drilling operations the need frequently arises todetermine the relative location of the wellbore being drilled (thedrilling well) with respect to a pre-existing offset wellbore (a targetwell). This need may exist for the purpose of avoiding a collision ormaking an interception, or for the purpose of maintaining a specifiedseparation distance between the wells (e.g., as in well twinningoperations such as steam assisted gravity drainage operations). Magneticranging techniques are commonly employed to determine the relativelocation of the target well, for example, by making magnetic fieldmeasurements in the drilling well. The measured magnetic field may beinduced in part by ferromagnetic material or an electromagnetic source(or sources) in the target well such that the measured magnetic fieldvector may enable the relative location of the target well to becomputed.

Existing magnetic ranging techniques are similar to conventional staticsurveys in that they require drilling to be halted and the drill stringto be held stationary in the drilling well while each magnetic survey isobtained. Magnetic ranging operations are therefore costly and timeconsuming. Moreover, magnetic ranging is similar to wellbore navigationin that the well path may be continuously adjusted in response to theranging measurements. It may therefore be desirable to make rangingmeasurements as close to the bit as possible, in order to gain theearliest possible notification of required course adjustments. Owing tothe rotation of the bit, measurements made close to the bit whiledrilling are made from a rotating platform (i.e., with rotating magneticfield sensors). There is a need in the art for magnetic ranging methodsthat employ magnetic field measurements made from a rotating platform(rotating sensors).

SUMMARY

A method for magnetic ranging is disclosed. A downhole drilling tool isrotated in a drilling well in sensory range of magnetic flux emanatingfrom a target well having an AC magnetic source deployed therein. Thedownhole tool includes a magnetic field sensor deployed therein. Themagnetic field sensor measures a magnetic field vector while rotating.The measured magnetic field vector is processed to compute at least oneof a distance and a direction from a drilling well to a target well.

The disclosed methods may enable magnetic ranging measurements to beacquired and processed while rotating the magnetic field sensors in thedrilling well. The measurements may therefore be acquired and processedwhile drilling. Moreover, in embodiments in which the magnetic fieldsensors are mounted in a near-bit sensor sub below a mud motor, theranging measurements may be acquired and processed while maintainingdrilling fluid circulation.

This summary is provided to introduce a selection of concepts that arefurther described below in the detailed description. This summary is notintended to identify key or essential features of the claimed subjectmatter, nor is it intended to be used as an aid in limiting the scope ofthe claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the disclosed subject matter, andadvantages thereof, reference is now made to the following descriptionstaken in conjunction with the accompanying drawings, in which:

FIG. 1 depicts one example of a conventional drilling rig and a targetwellbore with which disclosed methods may be utilized.

FIG. 2 depicts a lower BHA portion of the drill string shown on FIG. 1.

FIG. 3 depicts a flow chart of one disclosed method embodiment.

FIG. 4 depicts a schematic of the measured magnetic field in thetransverse plane.

FIG. 5 depicts a plot of the transverse magnetometer outputs B_(x) andB_(y) as a function of time.

FIG. 6 depicts an example plot of the radial B_(r) and axial B_(z)magnetic fields as a function of measured depth for an example targetwell including a premagnetized casing string.

FIG. 7 depicts one example of a plot of the high side BHS versus rightside BRS magnetic field components.

FIG. 8 depicts a plot of radial B_(r) and axial B_(z) magnetic fieldsverses axial position along the axis of target well having a residualremanent magnetism.

FIG. 9 depicts a flow chart of another disclosed method embodiment.

FIG. 10 depicts a schematic of the measured magnetic field including theEarth's field and target field in the transverse plane.

FIG. 11 depicts a flow chart of yet another disclosed method embodiment.

DETAILED DESCRIPTION

FIG. 1 depicts a drilling rig 20 suitable for using various methodembodiments disclosed herein. The rig may be positioned over an oil orgas formation (not shown) disposed below the surface of the Earth 25.The rig 20 may include a derrick and a hoisting apparatus for raisingand lowering a drill string 30, which, as shown, extends into wellbore40 and includes a drill bit 32 and a near-bit sensor sub 50 (such as theiPZIG® tool available from PathFinder®, A Schlumberger Company, Katy,Tex., USA). Drill string 30 may further include a downhole drillingmotor, a steering tool such as a rotary steerable tool, a downholetelemetry system, and one or more MWD or LWD tools including varioussensors for sensing downhole characteristics of the borehole and thesurrounding formation. The disclosed embodiments are not limited inthese regards.

FIG. 1 further depicts a well twinning operation, such as a steamassisted gravity drainage (SAGD) operation, in which various disclosedmethod embodiments may be utilized. In common SAGD well twinningoperations a horizontal twin well 40 is drilled a substantially fixeddistance above a horizontal portion of a target wellbore 80 (e.g., notdeviating more than about 1 meter up or down or to the left or right ofthe target). In the depicted embodiment the target well 80 is drilledfirst, for example, using conventional directional drilling and MWDtechniques. The target wellbore 80 may be magnetized, for example, viainstalling a plurality of premagnetized tubulars 85 in the wellbore ordeploying a magnetic source 88 such as a DC or an AC electromagnet inthe wellbore. Magnetic field measurements made while the drill string 30rotates in the drilling well 40 (e.g., at sensor sub 50) may then beused to determine a relative distance and direction from the drillingwell 40 to the target well 30 (as described in more detail below).

It will be understood by those of ordinary skill in the art that thedeployment illustrated on FIG. 1 is merely an example. For example,while FIG. 1 depicts a SAGD operation, the disclosed embodiments are inno way limited to SAGD or other well twinning operations, but may beused in substantially any drilling operation in which it is desirable todetermine the relative location of the drilling well with respect to anoffset well. Such operations may be performed onshore (as depicted) oroffshore.

FIG. 2 depicts the lower BHA portion of drill string 30 including drillbit 32 and near-bit sensor sub 50. In the depicted embodiment, sensorsub body 52 is threadably connected with the drill bit 32 and thereforeconfigured to rotate with the bit 32. The depicted sensor sub 50includes a tri-axial (three axis) accelerometer set 55 and a tri-axialmagnetometer set 57. In the depicted embodiment, the sensors 55 and 57being deployed in a near-bit sensor sub may be deployed close to thedrill bit 32, for example, within two meters, or even within one meterof the bit 32. However, it will be understood that the disclosedembodiments are not limited to the use of a near-bit sensor sub or tothe deployment of the sensor close to the bit. Substantially anysuitable measurement tool (such as a conventional MWD tool) including amagnetic field sensor may be utilized.

Suitable accelerometers and magnetometers for use in sensors 55 and 57may be chosen from among any suitable commercially available devicesknown in the art. For example, suitable accelerometers may include PartNumber 979-0273-001 commercially available from Honeywell, and PartNumber JA-5H175-1 commercially available from Japan Aviation ElectronicsIndustry, Ltd. (JAE). Other suitable accelerometers may includemicro-electro-mechanical systems (MEMS) solid-state accelerometers,available, for example, from Analog Devices, Inc. (Norwood, Mass.). SuchMEMS accelerometers may be advantageous for certain near bit sensor subapplications since they tend to be shock resistant, high-temperaturerated, and inexpensive. Suitable magnetic field sensors may includeconventional ring core flux gate magnetometers or conventionalmagnetoresistive sensors, for example, Part Number HMC-1021D, availablefrom Honeywell.

FIG. 2 further includes a diagrammatic representation of the tri-axialaccelerometer and tri-axial magnetometer sensor sets 55 and 67. Bytri-axial it is meant that each sensor set includes three mutuallyperpendicular sensors, the accelerometers being designated as A_(x),A_(y), and A_(z) and the magnetometers being designated as B_(x), B_(y),and B_(z). By convention, a right handed system is designated in whichthe z-axis accelerometer and magnetometer (A_(z) and B_(z)) are orientedsubstantially parallel with the borehole as indicated (althoughdisclosed embodiments are not limited by such conventions). Each of theaccelerometer and magnetometer sets may therefore be considered asdetermining a transverse cross-axial plane (the x and y-axes) and anaxial pole (the z-axis along the axis of the BHA).

By further convention, the gravitational field is taken to be positivepointing downward (i.e., toward the center of the Earth) while themagnetic field is taken to be positive pointing towards magnetic north.Moreover, also by convention, the y-axis is taken to be the toolfacereference axis (i.e., gravity toolface T equals zero when the y-axis isuppermost and magnetic toolface M equals zero when the y-axis ispointing towards the projection of magnetic north in the transverse (xy)plane). Those of ordinary skill in the art will readily appreciate thatthe magnetic toolface M is projected in the xy plane and may berepresented mathematically as: tan M=B_(x)/B_(y). Likewise, the gravitytoolface T may be represented mathematically as: tan T=−A_(x)/−A_(y).Those of skill in the art will understand that the negative sign in thegravity toolface expression arises owing to the convention that thegravity vector is positive in the downward direction while the toolfacereference direction is the high side of the borehole (the side facingupward).

It will be understood that the disclosed embodiments are not limited tothe above described conventions for defining the borehole coordinatesystem. It will be further understood that these conventions can affectthe form of certain of the mathematical equations that follow in thisdisclosure. Those of ordinary skill in the art will be readily able toutilize other conventions and derive equivalent mathematical equations.

FIG. 3 depicts a flow chart of one disclosed method embodiment 100. Asensor sub (e.g., sub 50) including accelerometers and magnetometers isrotated in a drilling well at 102 in sensory range of magnetic fluxemanating from a target wellbore. Accelerometer and magnetometermeasurements are acquired at 104 while rotating in 102. The acquiredtransverse magnetometer measurements may be transformed at 106 to areference frame that is independent of the sensor rotation in 102. Thetransformed measurements may then be processed at 108 to compute atleast one of a distance and a direction from the drilling well to thetarget well.

During rotation at 102, the transverse sensor (accelerometers A_(x) andA_(y) and magnetometers B_(x) and B_(y)) measurements may be expressedmathematically, for example, as follows:A _(x) =−A _(xy)·sin T  (1)A _(y) =−A _(xy)·cos T  (2)B _(x) =B _(xy)·sin M  (3)B _(y) =B _(xy)·cos M  (4)

where A_(xy) represents the transverse component of the acceleration(e.g., due to gravity), B_(xy) represents the transverse component ofthe magnetic field, and T and M represent gravity and magnetic tool faceas defined above. With reference to FIG. 4, recognizing that thetoolface offset angle T−M is independent of rotation (toolface offsetdepends on the wellbore attitude and the magnetic dip angle) enables thetransverse measurements to be transformed into a reference frame that isindependent of the rotation. Equations 1-4 may be rearranged, forexample, as follows:B _(x) ·A _(y) −B _(y) ·A _(x) =B _(xy) ·A _(xy)·sin(T−M)  (5)B _(x) ·A _(x) +B _(y) ·A _(y) =−B _(xy) ·A _(xy)·cos(T−M)  (6)

Equations 5 and 6 may be combined, for example, as follows to obtain thetoolface offset (T−M):

$\begin{matrix}{\left( {T - M} \right) = {\tan^{- 1}\left\lbrack \frac{\left( {{B_{x} \cdot A_{yx}} - {B_{y} \cdot A_{x}}} \right)}{\left( {{{- B_{x}} \cdot A_{x}} - {B_{y} \cdot A_{y}}} \right)} \right\rbrack}} & (7)\end{matrix}$

which as illustrated in FIG. 4 is the direction of the transversecomponent B_(xy) with respect to the highside (HS) of the wellbore. Themagnitude of the transverse component B_(xy) may be obtained, forexample, from one of the following equations:B _(xy)=√{square root over ((B _(x) ² +B _(y) ²))}  (8)B _(xy)=√{square root over (2·σ(B _(x))·σ(B _(y)))}  (9)

where σ(B_(r)) and σ(B_(y)) represent the standard deviations of B_(x)and B_(y). Note that both the magnitude B_(xy) and direction (T−M) ofthe transverse field given in Equations 7, 8, and 9 are invariant underdrill string rotation.

Accelerometer measurements made while rotating (particularly whiledrilling) are generally noisy owing to vibration of the drill string.Therefore, it may be advantageous to average the transverseaccelerometer measurements over a time period such as several seconds inorder to obtain an accurate measure of the toolface offset. Since thetransverse accelerometer measurements vary with rotation it is desirableto compute an average toolface offset, for example, as follows:

$\begin{matrix}{\left( {T - M} \right) = {\tan^{- 1}\left\lbrack \frac{\sum\left( {{B_{x} \cdot A_{y}} - {B_{y} \cdot A_{x}}} \right)}{\sum\left( {{{- B_{x}} \cdot A_{x}} - {B_{y} \cdot A_{y}}} \right)} \right\rbrack}} & (10)\end{matrix}$

where Σ(⋅) represents a summation of a number of accelerometer andmagnetometer measurements (acquired over a period of time). In anembodiment in which the accelerometer and magnetometer measurements areacquired at 10 millisecond intervals, the measurements may beadvantageously summed (averaged) over a time interval in a range fromabout 1 to about 300 seconds (e.g., about 30 seconds). The magnitude ofthe transverse component B_(xy) may be similarly averaged.

Turning to FIG. 5, the transverse magnetometer outputs may be plottedwith time as the measurement tool rotates in the drilling well. Asdescribed above with respect to Equations 3 and 4, B_(x) and B_(y) varysinusoidally with an amplitude equal to the magnitude of the transversecomponent B_(xy). Moreover, as also depicted, the mean value for eachsensor is equal to the sensor bias (over an integer number of periods).The mean values acquired during rotation may therefore enable the sensorbiases to be removed (e.g., subtracted) prior to other processing. Uponremoving the B_(x) and B_(y) biases, the toolface offset computed usingEquation 9 is unaffected by transverse accelerometer bias (e.g., due tocentripetal acceleration during rotation). Alternatively, the transverseaccelerometer biases may be similarly removed in which case the toolfaceoffset obtained via Equation 10 is unaffected by transverse magnetometerbiases.

The transverse magnetic field may alternatively and/or additionally beexpressed in terms of high side BHS and right side BRS components, forexample, as follows:BHS=B _(xy)·cos(T−M)  (11)BRS=B _(xy)·sin(T−M)  (12)

The axial magnetic field measurement and the axial accelerationcomponent (measured by the B_(z) magnetometer and the A_(z)accelerometer) may also be averaged as described above for thetransverse measurements (e.g., over the same time interval). Inembodiments utilizing a near-bit sensor sub (as depicted on FIG. 2) theaxial magnetometer measurements may be contaminated by remanent andinduced magnetic interference from nearby ferromagnetic drilling toolcomponents. Such magnetic interference may be removed, for example, asdescribed in U.S. Patent Publication 2013/0069655 (which is incorporatedby reference in its entirety herein).

Based on the foregoing discussion, the three-dimensional magnetic fieldmeasured while rotating may be transformed from a tool based x/y/zcoordinate system to a rotation invariant high side/right side/axialcoordinate system. Alternatively, the three-dimensional magnetic fieldmeasured while rotating may be expressed as the magnitude of thetransverse component B_(xy), the toolface offset angle (T−M), and themagnitude of the axial component B_(z). The three components of therotation invariant magnetic field vector (e.g., BHS, BRS, and B_(z)) maybe computed downhole as described above and transmitted to the surfaceusing conventional telemetry techniques (e.g., via mud pulse or mudsiren telemetry techniques). It may also be advantageous to transmiteither the axial accelerometer measurement A_(z) or the boreholeinclination Inc, which may be computed from the axial accelerometermeasurement, for example, as follows:

$\begin{matrix}{{Inc} = {\cos^{- 1}\left( \frac{A_{z}}{G} \right)}} & (13)\end{matrix}$

where G represents the local gravitational field of the Earth which maybe determined from an external source or from the tri-axialaccelerometer array during times in which the sensor sub is notrotating.

In certain embodiments the measured transverse magnetic field componentsmay be perturbed by rotation of the drill string which can produce eddycurrents in the electrically conductive collar. Such phenomenon has beendisclosed, for example, in U.S. Pat. No. 5,012,412. In order tocompensate for the effect of rotation induced eddy currents, it may alsobe desirable to transmit to the rotary speed (the rotation rate) of thesensor sub to the surface. The rotary speed rpm may be found, forexample, as follows:

$\begin{matrix}{{rpm} = {\frac{60\mspace{14mu} s}{\left( {2\pi\; N} \right)}{\sum\limits_{i = 1}^{N}\left\lbrack {{{mod}\left( {{M_{i} - M_{i - 1} + \pi},{2\pi}} \right)} - \pi} \right\rbrack}}} & (14)\end{matrix}$

where the summation is over N samples acquired at s per second (e.g.,3000 samples acquired at 100 samples per second) and M_(i) representsthe magnetic tool face of the i^(th) sample.

Since the error in the direction of the transverse magnetic componentcaused by the conductive collar is approximately proportional to rotaryspeed, it may be represented by a fixed time delay between theaccelerometer and magnetometer measurements. The effect may therefore becorrected by shifting the acquisition times for one set of sensors(either the accelerometers or magnetometers). This may be accomplished,for example, through the use of appropriate filters which delay theaccelerometer signals with respect to the magnetometer signals. Themethodologies disclosed in U.S. Pat. No. 7,650,269 and U.S. PatentPublications 2007/0203651 and 2010/0250207 may also optionally beemployed to address any transverse magnetic field perturbations due toeddy currents in the drill collar.

The magnetic field components measured downhole represent the sum of thelocal Earth's magnetic field and the field from the target (as well asany magnetic interference from the drill string—which may be removed asdescribed above). In order to obtain the target field from whichmagnetic ranging calculations are made, it may be necessary to removethe Earth's field components from the measured field. This may berepresented mathematically, for example, as follows:

_(T)=

_(m)−

_(e)  (15)

where

_(T) represents the target magnetic field vector,

_(m) represents the measured magnetic field vector, and

_(e) represents the Earth's magnetic field vector. It will be understoodthat computing the target field vector may require that the measuredmagnetic field vector and the Earth's magnetic field vector betransformed into the same coordinate system (e.g., the rotationinvariant system described above).

The magnetic field of the Earth (including both magnitude and directioncomponents) is typically known, for example, from previous geologicalsurvey data or a geomagnetic model. However, for some applications itmay be advantageous to measure the magnetic field in real time on siteat a location substantially free from magnetic interference, e.g., atthe surface of the well or in a previously drilled well. Measurement ofthe magnetic field in real time is generally advantageous in that itaccounts for time dependent variations in the Earth's magnetic field,e.g., as caused by solar winds. However, at certain sites, such as anoffshore drilling rig, measurement of the Earth's magnetic field in realtime may not be practical. In such instances, it may be preferable toutilize previous geological survey data in combination with suitableinterpolation and/or mathematical modeling (i.e., computer modeling)routines. Those of ordinary skill in the art will readily be able totransform the Earth's field to the above described high side/rightside/axial reference frame, for example, using measured boreholeinclination and borehole azimuth values.

Magnetic Ranging to a DC Target

The disclosed magnetic ranging embodiments may be utilized with amagnetic target including substantially any suitable DC magnetization.For example, the target well may include a magnetized casing string. Thecasing string may be intentionally magnetized so as to impart a knownmagnetic pattern to the string, for example, as disclosed in U.S. Pat.Nos. 7,538,650, 7,656,161, and 8,026,722, each of which is incorporatedby reference herein in its entirety. In one embodiment commonly used inSAGD operations, the casing string may be magnetized such that eachtubular in a premagnetized region of the casing includes a single pairof magnetically opposing poles (NN or SS) located at the approximatemidpoint of the tubular. In this embodiment, the pairs of opposing polesare spaced at intervals about equal to the length of the tubulars, whilethe period of the magnetic field pattern (e.g., the distance from one aNN pair of opposing poles to the next) is about twice the length of thetubular.

When ranging to a target including premagnetized casing (also referredto as remanent magnetism), the magnetic field of the Earth

_(e) may be subtracted, for example, as described above with respect toEquation 15. Alternatively, periodic variations in the measured magneticfield along the length (axis) of the drilling well may be used toseparate the Earth's field from the target field. FIG. 6 depicts a plotof radial B_(r) and axial B_(z) magnetic field components versusmeasured depth for an example target well having a casing stringpremagnetized as described above. The components B_(r) and B_(z) areequivalent to the measured values of and B_(xy) when the drilling wellis approximately parallel to the target well (e.g., within about 10degrees of parallel).

In embodiments in which the drilling well is a sufficient distance fromthe target well (e.g., greater than about one third of the axialdistance between adjacent NN and SS opposing magnetic poles) the axialcomponent B_(z) displays a single maximum or minimum between adjacent NNand SS poles. The maxima and minima of the axial component B_(z)correspond to the midpoints between the NN and SS poles where the targetproduces essentially no transverse magnetic field. Thus the values ofBHS and BRS at these points may be taken to define the transversecomponent of the Earth's field. Conversely, maxima and minima of thetransverse components BHS and BRS correspond to points opposite the NNand SS poles where the target produces essentially no axial magneticfield. Thus the value of the axial component B_(z) at these points maybe taken to define the axial component of the Earth's field.

In embodiments in which the drilling well is closer to the target well(e.g., less than about one third of the axial distance between adjacentNN and SS opposing magnetic poles), the axial component B_(z) maydisplay multiple maxima and/or minima between adjacent NN and SS poles(e.g., two maxima and one minimum or two minima and one maximum. In suchembodiments, the single maximum or single minimum about which the axialcomponent is symmetrical corresponds to the midpoints between the NN andSS poles where the target produces essentially no transverse magneticfield. Thus the values of BHS and BRS at these points may be taken todefine the transverse component of the Earth's field.

Upon removing the Earth's magnetic field, the distance to the targetwellbore may be computed from the target magnetic field vector and theknown pole strengths imparted to the target well. For example, themagnitude of the transverse component of the target magnetic field maybe processed in combination with an empirical or theoretical model ofthe magnetic field about the target to compute the distance. Moreover,the high side and right side components of the target magnetic field maybe processed to compute the distance and/or direction to the targetwell. U.S. Pat. No. 7,617,049, which is incorporated by reference hereinin its entirety, discloses other suitable methods for computing thedistance and/or direction between a drilling well and a target wellusing magnetic ranging measurements.

The direction in the transverse plane to the target well mayalternatively and/or additionally be obtained via plotting the high sideand right side components BHS and BRS of the measured magnetic field.FIG. 7 depicts a plot of the high side BHS versus right side BRScomponents of the measured magnetic field. The slope of the plotrepresents the tool face to target (TFT) direction (the direction to thetarget well in the transverse plane). The TFT may be determined in thisway prior to removing the Earth's magnetic field from the measuredmagnetic field. FIG. 7 also depicts the maxima and minima of thetransverse magnetic field component (the locations of the NN and SSpoles). Moreover, the midpoint of the plot represents the transversecomponent of the Earth's magnetic field.

The casing string may include a residual remanent magnetism impartedduring a magnetic particle inspection of the threaded ends of the casingtubulars. Magnetic ranging to such residual remanent magnetism iscommonly referred to in the art as passive ranging. Such passive rangingcan be challenging as the residual remanent magnetism tends to be highlylocalized at the ends of the casing tubulars, and consequently at thecasing joints within the target wellbore. Moreover, the magnetic fieldstrengths of the poles can be weak and unknown; therefore resulting in amagnetic field pattern that also tends to be unknown. Notwithstanding,magnetic ranging to target wells including residual remanent magnetismmay be required, for example, when attempting to intercept the targetwell with a relief well, particularly when a close approach is used in anon-conductive formation such as salt, which tends to prevent the use ofactive ranging techniques.

Owing to the relatively low magnitude of the target magnetic field,passive ranging is generally utilized at close distances (e.g., withinfive meters or less of the target). At close distances, each pole maypresent a signature such as that depicted on FIG. 8 (which is a plot ofthe radial and axial components of the measured magnetic field versusaxial position along the target well). The axial distance δz betweenopposing peaks (maxima and minima) of the axial component may be used toestimate the distance to the target. For example, the target magneticfield may be approximated to be emanating from a monopole located at thecasing joint (this may be a reasonable assumption since the residualremanent magnetism tends to be highly localized at the ends of thecasing tubulars). The axial component of the target field B_(zt) maythen be expressed mathematically, for example, as follows:

$\begin{matrix}{B_{zt} = {\frac{P}{4\pi}\frac{z - z_{0}}{\left\lbrack {d^{2} + \left( {z - z_{0}} \right)^{2}} \right\rbrack^{1.5}}}} & (16)\end{matrix}$

where P represents the magnetic pole strength, d represents the radialdistance to the target, z represents the axial position of the magneticfield sensor, and z₀ represents the axial position of the magneticsource (e.g., the joint between adjacent casing tubulars). Equation 16may be differentiated with respect to the axial direction, for example,as follows:

$\begin{matrix}{\frac{d\; B_{zt}}{d\; z} = {\frac{P}{4\;\pi}\frac{d^{2} - {2\left( {z - z_{0}} \right)^{2}}}{\left\lbrack {d^{2} + \left( {z - z_{0}} \right)^{2}} \right\rbrack^{2.5}}}} & (17)\end{matrix}$

The axial positions of the maximum and minimum may be obtained bysetting Equation 17 to zero which yields d²=2(z−z₀)². Assuming from FIG.8 that δz=2(z−z₀) yields the following expression for the distancebetween the drilling well and the target well:d=√{square root over (2)}(z−z ₀)=δz/√{square root over (2)}  (18)

It will be understood that the methodology described above with respectto Equations 16-18 and FIG. 8 does not necessarily require the Earth'smagnetic field to be removed from the magnetic field measurements. Thedirection in the transverse plane to the target well may be obtained viaplotting the high side and right side components BHS and BRS of themeasured magnetic field as described above with respect to FIG. 7. Suchprocessing may also be performed without removing the Earth's magneticfield from the measured magnetic field.

The target magnetic field may also be obtained by removing the Earth'smagnetic field

_(e), for example, as describe above with respect to Equation 15. Thetarget magnetic field may then be processed to compute the distanceand/or the direction (e.g., the TFT) to the target well, for example,using the one or more of the techniques disclosed in U.S. Pat. No.6,985,814, which is incorporated by reference herein in its entirety.

The target well may alternatively and/or additionally include a directcurrent (DC) electromagnetic source deployed therein. Theelectromagnetic source, such as a solenoid, may be moved along the axisof the target during the drilling operation and may further becontrolled during drilling, for example, via switching the source on oroff, varying its intensity, or reversing its polarity.

The target magnetic field may be found, for example, from the differencebetween measurements taken with the source excited in two differentstates such as two opposing polarities (e.g., positively and negativelydirected current in the solenoid). The three components of the targetmagnetic field vector (BHS, BRS, and B_(z) of the target) may beresolved into distance and direction by inversion of models or maps ofthe field around the target.

The Earth's field may be found from a measurement taken with the sourceswitched off, or from the average of two measurements in which thesource was excited with equal amplitude in two opposing polarities.Measurement of the Earth's field components in this way may be used toascertain the attitude of the receiver by the use of standardrelationships well known in magnetic wellbore surveying.

Magnetic Ranging to an AC Target

FIG. 9 depicts a flow chart of another disclosed method embodiment 120.A sensor sub including a magnetic field sensor (such as a tri-axialmagnetometer set) is rotated in a drilling wellbore at 122 in sensoryrange of AC magnetic flux emanating from a target wellbore (note thatthe sensor sub may optionally, but does not necessarily, includeaccelerometers). Magnetic sensor measurements are acquired at 124 whilerotating in 122 to obtain a magnetic field vector. The measured magneticfield vector is processed at 126 to compute at least one of (i) theamplitude of the transverse component of the AC magnetic flux emanatingfrom the target wellbore and (ii) the angle between the transversecomponent of the AC magnetic flux emanating from the target wellbore andthe transverse component of the Earth's magnetic field. The computedquantity (or quantities) may then be further processed at 128 to computeat least one of a distance and a direction from the drilling well to thetarget well.

The disclosed magnetic ranging embodiments may be utilized with amagnetic target including substantially any suitable AC magnetization.In such operations the target well may include an electromagnet poweredby an alternating current (AC) power source. The magnetic field about anAC target B_(T) may be expressed mathematically, for example, asfollows:B _(T) =B _(Ta) sin(ωt+ϕ)  (19)

where B_(Ta) represents the amplitude of the magnetic field, ωrepresents the known frequency, and ϕ represents an arbitrary phase.When in sensory range of the target, the axial (z-axis) magnetic fieldB_(z) may be expressed as follows:B _(z) =B _(ez) +B _(Tz)  (20)

where B_(ez) represents the axial component of the Earth's field andB_(Tz) represents the axial component of the target AC field. It will beunderstood from Equation 20 that the mean value (the DC value) of B_(z)is equal to B_(ez) and that the periodic variations from the mean may beused to compute the amplitude and phase of B_(Tz). When magnetic fieldmeasurements are acquired over an interval of several cycles (preferablyover an integer number of cycles—which may be readily achieved since thesource frequency is known), the mean value of a set of measured B_(z)measurements represents the axial component of the Earth's field. Thus,subtracting the mean value from each individual B_(z) measurement givesthe corresponding B_(Tz). These operations may be expressedmathematically, for example, as follows:

$\begin{matrix}{B_{zm} = {\frac{\Sigma\; B_{z}}{N} = B_{ez}}} & (21) \\{B_{Tz} = {B_{z} - B_{zm}}} & (22)\end{matrix}$

where B_(zm) represents the mean value of a set of B_(z) measurements.The standard deviation of the set of B_(z) measurements represents theroot mean square (rms) amplitude of B_(Tz). The amplitude B_(za) ofB_(z) may thus be found by multiplying the root mean square value by thesquare root of two and the phase information sin(ωt+ϕ) may be found bydividing B_(Tz) by B_(za). These operations may be expressedmathematically, for example, as follows

$\begin{matrix}{B_{Tzrms} = {\sigma\left( B_{z} \right)}} & (23) \\{B_{za} = {\sqrt{2}B_{Tzrms}}} & (24) \\{{\sin\left( {{\omega\; t} + \phi} \right)} = \frac{B_{Tz}}{B_{za}}} & (25)\end{matrix}$

where B_(Tzrms) represents the root mean square amplitude of B_(z) andσ(⋅) represents the standard deviation. While Equations 19, 24 and 25may imply that the target field B_(T) is sinusoidal, the disclosedembodiments are expressly not limited in this regard. In practice thetarget field may deviate from a sine wave, as nonlinearity andhysteresis of ferromagnetic materials in the solenoid core and targetcasing may distort the waveform of the magnetic field (even when theinput AC current is perfectly sinusoidal). The deviation of the magneticfield from a sine wave may be modeled or measured and suitablecorrections made, if necessary.

FIG. 10 depicts the transverse (xy) magnetic field vectors. Note thatthe transverse alternating magnetic field

_(xy) measured by the rotating x- and y-axis magnetic field sensors isthe vector sum the transverse components of the Earth's magnetic fieldvector

_(exy) and the target well's magnetic field vector

_(Txy). The target field oscillates between positive and negative maxima

_(Txy)(ϕ) and

_(Txy)(ϕ+π) at a frequency ω. As such the measured field also oscillatesat a frequency ω (e.g., between

_(xy)(ϕ) and

_(xy)(ϕ+π) as indicated). The aforementioned vector sum of thetransverse components may be expressed mathematically, for example, asfollows:

_(xy)(ϕ)=

_(exy)+

_(Txy)(ϕ)  (26)

With continued reference to FIG. 10, the magnitude of the transversecomponent of the measured magnetic field B_(xy) may be expressedmathematically, for example, as follows (using the law of cosines):B _(xy)=√{square root over ((B _(exy) ² +B _(Txy) ²−2B _(exy) B _(Txy)cos θ))}  (27)

where B_(exy) represents the magnitude of the transverse component ofthe Earth's field, B_(Txy) represents the magnitude of the transversecomponent of the target field, and θ represents the angle between thetransverse components of the Earth's magnetic field vector and thetarget magnetic field vector. The direction of the transverse componentof the measured magnetic field vector B_(xy) diverges from thetransverse component Earth's magnetic field vector B_(exy) by the angleα where (using the law of sines):

$\begin{matrix}{{\sin\;\alpha} = \frac{{B_{Txy} \cdot \sin}\;\theta}{B_{xy}}} & (28)\end{matrix}$

It will thus be understood that both the amplitude and direction of themeasured transverse component oscillate with the target field, forexample, as follows:B _(Txy) =B _(Txya) sin(ωt+ϕ)  (29)

where B_(Txya) represents the amplitude of the transverse magnetic fieldfrom the target and where at any time t the corresponding value ofsin(ωt+ϕ) may be obtained from the axial measurement (even when themagnetic field is non-sinusoidal). The magnitude of the transversecomponent of the measured magnetic field can be computed from the x- andy-axis magnetometer measurements (e.g., B_(xy) ²=B_(x) ² B_(y) ²).Combining Equations 27 and 29 enables the magnitude of the transversecomponent of the measured magnetic field to be expressed as a quadraticfunction of the phase sin(ωt+ϕ), for example, as follows:B _(xy) ² =B _(Txya) ² sin²(ωt+ϕ)−2B _(xye) B _(Txya) cos θ sin(ωt+ϕ)+B_(xye) ²  (30)

Since sin(ωt+ϕ) is known at any instant in time from the axial magneticfield measurements (Equation 25), and since corresponding values ofB_(xy) are measured, a standard least-squares fit may be applied todetermine the quadratic coefficients B_(Txya) ², 2B_(xye)B_(Txya) cos θ,and B_(xye) ², from which B_(Txya), B_(exy), and θ may be determined.These parameters may then be used to obtain the distance and directionto the target well as described in more detail below.

The coefficients in a quadratic equation y=a·x²+b·x+c may be found, forexample, as follows when x and y are known:

$\begin{matrix}{{\begin{matrix}a \\b \\c\end{matrix}} = {{\begin{matrix}{\Sigma\; x^{4}} & {\Sigma\; x^{3}} & {\Sigma\; x^{2}} \\{\Sigma\; x^{3}} & {\Sigma\; x^{2}} & {\Sigma\; x} \\{\Sigma\; x^{2}} & {\Sigma\; x} & N\end{matrix}}^{- 1} \times {\begin{matrix}{\Sigma\; x^{2}y} \\{\Sigma\; x\; y} \\{\Sigma\; y}\end{matrix}}}} & (31)\end{matrix}$

where y=B_(xy) ², x=sin(ωt+ϕ), and Σ(⋅) indicates a sum over apredetermined number of measurements. For example, measurements may beacquired at 10 millisecond intervals for 30 seconds to obtain 3000accelerometer and magnetometer measurements. In an embodiment in whichthe AC frequency is 10 Hz these measurements span 300 cycles.

It will be understood that the foregoing discussion has assumed that theAC magnetic field emanating from the target is substantially sinusoidal.However, the disclosed embodiments are not limited in this regard. Inpractice, when ranging to an AC solenoid, the received magnetic fieldmay be non-sinusoidal. While the solenoid may be driven by a sinusoidalcurrent, nonlinear behavior of ferromagnetic materials in the solenoidcore and/or in the casing may cause the emitted AC magnetic field to benon-sinusoidal. In particular, the magnetic field may contain a thirdharmonic corresponding to a depression of the peak values resulting frommaterial nonlinearity as magnetic saturation is approached.

A non-sinusoidal magnetic field may result in biased ranging resultsunless compensation is made. The waveform of the target magnetic fieldcan be determined from the measured axial component, or frommeasurements of transverse components during intervals of non-rotationof the magnetic sensors. Corrections for harmonics (such as the abovedescribed third harmonic) may then be made by modeling their effect orby experiments conducted at the surface. Alternatively, the solenoid maybe driven by a non-sinusoidal current whose waveform is adjusted toproduce a sinusoidal magnetic field at the receiver. The waveform may bedetermined by modeling, by experiments conducted at the surface, or byfeedback from real-time measurements of the received magnetic waveforms.The disclosed embodiments are not limited in this regard.

For example, a method for magnetic ranging may include deploying amagnetic field sensor in sensory range of magnetic flux emanating from aferromagnetic casing string having an AC magnetic source deployedtherein. The casing may be deployed at the surface or in a target well.Magnetic field measurements may be processed to compute an amplitude ofat least one higher order harmonic of the AC magnetic field. The ACmagnetic source may then be energized with a non-sinusoidal inputelectrical current to reduce (or eliminate) the amplitude of the higherorder harmonic.

The above described magnetic ranging technique tends to be effectivewhen the magnitude of B_(xy) is a strong function of the target field;i.e., when the angle θ in FIG. 10 is small (e.g., less than about 45degrees). This may be the case when drilling twin well pairs for SAGDapplications in northern latitudes (where the magnetic dip angle ishigh). However, when the angle between these components is large (e.g.,greater than about 45 degrees), the magnitude of B_(xy) is lessdependent on the target field and thus it may be beneficial toalternatively and/or additionally examine the oscillating direction α.The direction α may be observed as a regular variation in apparentrotary speed calculated using x- and y-axis magnetometers.

FIG. 11 depicts a flow chart of yet another disclosed method embodiment140. A sensor sub including a magnetic field sensor (such as a tri-axialmagnetometer set) is rotated in a drilling wellbore at 142 in sensoryrange of AC magnetic flux emanating from a target wellbore (note thatthe sensor sub may optionally, but does not necessarily includeaccelerometers). Magnetic sensor measurements are acquired at 144 whilerotating in 142 to obtain a magnetic field vector. The measured magneticfield vector is processed at 146 to compute a difference between aninstantaneous rotation rate and an average rotation rate of the sensorsub. The computed difference is processed at 148 to compute a directionfrom the drilling well to the target well. The difference may beoptionally further processed at 150 to compute a distance to the targetwell.

At each instant (i.e., at each magnetometer measurement interval—such as10 millisecond), an apparent magnetic toolface may be computed, forexample, as described above with respect to FIG. 2(M=tan⁻¹(B_(x)/B_(y))). The instantaneous rotary speed rpm_(t) may becomputed from the difference between successive toolface values, forexample, as follows:

$\begin{matrix}{{{rp}\; m_{t}} = {\frac{60\mspace{14mu} s}{\left( {2\;\pi} \right)}\left\lbrack {{{mod}\left( {{M_{t} - M_{t - 1} + \pi},{2\;\pi}} \right)} - \pi} \right\rbrack}} & (32)\end{matrix}$

where s represents the magnetometer sample rate (measurement interval).It will be understood that the magnetic toolface M is measured withrespect to the transverse component of the measured magnetic field(i.e.,

_(xy)). As described above with respect to FIG. 10, the direction of

_(xy) is offset from the transverse component of the Earth's magneticfield

_(exy) by the angle α which varies at frequency ω. Thus, the calculatedinstantaneous rotary speed is directly affected by the rate of change ofthe reference direction, which may be expressed mathematically, forexample, as follows:

$\begin{matrix}{{{rp}\; m_{t}} = {{{rp}\; m\; a\; v\; g} - {\frac{60\mspace{14mu} s}{\left( {2\;\pi} \right)} \cdot \frac{\partial\alpha}{\partial t}}}} & (33)\end{matrix}$

where rpmavg represents the average rotary speed determined, forexample, via Equation 14 and ∂∝/∂t represents the rate of change of theangle α which may be evaluated by applying the law of sines to thediagram on FIG. 10, for example, as follows:

$\begin{matrix}{\frac{\sin\;\alpha}{B_{Txy}} = \frac{\sin\left( \;{\theta + \alpha} \right)}{B_{exy}}} & (34)\end{matrix}$

from which it follows that:

$\begin{matrix}{{\tan\;\alpha} = \frac{B_{Txy}\sin\;\theta}{B_{exy} - {B_{Txy}\cos\;\theta}}} & (35)\end{matrix}$

Differentiating Equation 35 yields:

$\begin{matrix}{\frac{\partial\alpha}{\partial t} = {{\frac{\partial\alpha}{\partial B_{Txy}}\frac{\partial B_{Txy}}{\partial t}} = \frac{B_{exy}{B_{Txya} \cdot \omega}\;{\cos\left( {{\omega\; t} + \phi} \right)}\sin\;\theta}{\left( {B_{exy}^{2} + B_{Txy}^{2} - {2B_{exy}B_{Txy}\;\cos\;\theta}} \right.}}} & (36)\end{matrix}$

From Equation 33 the deviation of the measured rotary speed from theaverage rotary speed Δrpm may be given as follows:

$\begin{matrix}{{\Delta\;{rpm}} = {{- \frac{60}{\left( {2\;\pi} \right)}} \cdot \frac{\partial\alpha}{\partial t}}} & (37)\end{matrix}$

Substituting Equation 36 into Equation 37 yields:

$\begin{matrix}{{\Delta\;{rpm}} = {{- \frac{60}{\left( {2\;\pi} \right)}} \cdot \frac{B_{exy}{B_{Txya} \cdot \omega}\;{\cos\left( {{\omega\; t} + \phi} \right)}\sin\;\theta}{B_{exy}^{2} + B_{Txy}^{2} - {2B_{exy}B_{Txy}\;\cos\;\theta}}}} & (38)\end{matrix}$

In many magnetic ranging operations to an AC target, it may be assumedthat the Earth's field B_(exy) is much larger than the target fieldB_(Txya) such that Equation 37 may be simplified, for example, asfollows:

$\begin{matrix}{{\Delta\;{rpm}} \approx {{{- \frac{60}{\left( {2\;\pi} \right)}} \cdot \frac{{B_{Txya} \cdot \sin}\;\theta}{B_{exy}}}\omega\;{\cos\left( {{\omega\; t} + \phi} \right)}}} & (39)\end{matrix}$

Note that in Equation 39 the deviation (or variation) in the measuredrotary speed Δrpm is sinusoidal (proportional to cos(ωt+ϕ)) at the ACexcitation frequency ω with an amplitude equal to B_(Txya)·sinθ/B_(exy). The amplitude is proportional B_(Txya) and may thus berelated to the distance from the drilling well to the target well (e.g.,using one or more of the above described methods). Moreover, the Earth'sfield B_(exy) may be known from other measurements.

In many ranging operations employing an AC target, it may beadvantageous to employ both of the above described methodologies (thefirst based on the magnitude of B_(xy) described with respect toEquations 27-30 and the second based on the oscillating directiondescribed with respect to Equations 31-38). For example, the firstmethodology may be employed to obtain values of B_(Txya) and θ while thesecond methodology may be employed to obtain the sign (positive ornegative) of sin θ which indicates whether the target is to the right orleft of the drilling well. Alternatively, both methodologies may beemployed simultaneously to provide a more robust solution for B_(Txya)and θ (i.e., a solution having reduced noise).

The three components of the AC target magnetic field (B_(Txya), θ, andB_(za) of the target) may be resolved into distance and direction byinversion of models or maps of the field around the target. For example,the amplitude of the transverse component of the target field B_(Txya)may be resolved into distance using an empirical or theoretical model ormap of the target field and the angle θ between the Earth's field andthe target field may be resolved into a toolface to target direction,for example, as follows:TFT=θ+(T−M)  (40)

where TFT represents the toolface to target direction in the transverseplane and (T−M) represents the above described toolface offset that maybe measured, for example, using Equation 9 at times when the AC targetis not energized.

It will be understood that while not shown in FIGS. 1 and 2, downholemeasurement tools suitable for use with the disclosed embodimentsgenerally include at least one electronic controller. Such a controllermay include signal processing circuitry including a digital processor (amicroprocessor), an analog to digital converter, and processor readablememory. The controller may also include processor-readable orcomputer-readable program code embodying logic, including instructionsfor computing various parameters as described above, for example, withrespect to the disclosed mathematical equations. One skilled in the artwill also readily recognize some of the above mentioned equations mayalso be solved using hardware mechanisms (e.g., including analog ordigital circuits).

A suitable controller may include a timer including, for example, anincrementing counter, a decrementing time-out counter, or a real-timeclock. The controller may further include multiple data storage devices,various sensors, other controllable components, a power supply, and thelike. The controller may also optionally communicate with otherinstruments in the drill string, such as telemetry systems thatcommunicate with the surface or an EM (electro-magnetic) shorthop thatenables the two-way communication across a downhole motor. It will beappreciated that the controller is not necessarily located in the sensorsub (e.g., sub 60), but may be disposed elsewhere in the drill string inelectronic communication therewith. Moreover, one skilled in the artwill readily recognize that the multiple functions described above maybe distributed among a number of electronic devices (controllers).

Although magnetic ranging while rotating and certain advantages thereofhave been described in detail, it should be understood that variouschanges, substitutions and alternations can be made herein withoutdeparting from the spirit and scope of the disclosure as defined by theappended claims.

What is claimed is:
 1. A method for magnetic ranging comprising: (a)rotating a downhole drilling tool in a drilling well in sensory range ofmagnetic flux emanating from a target well having an AC magnetic sourcedeployed therein, the downhole drilling tool including a magnetic fieldsensor rotatably coupled to the downhole drilling tool; (b) causing themagnetic field sensor to measure a magnetic field vector while rotatingin (a); (c) processing the magnetic field vector measured in (b) tocompute a magnetic quantity including an amplitude of a transversecomponent of the magnetic flux emanating from the target well and anangle between the transverse component of the magnetic flux emanatingfrom the target well and a transverse component of Earth's magneticfield; and (d) processing the magnetic quantity computed in (c) tocompute at least one of a distance and a direction from the drillingwell to the target well.
 2. The method of claim 1, wherein the magneticfield sensor comprises a tri-axial set of magnetometers and the downholedrilling tool further comprises a tri-axial set of accelerometers. 3.The method of claim 1, wherein the quantity computed in (c) istransmitted to a surface location and the processing in (d) is performedat the surface location.
 4. The method of claim 1, wherein: theprocessing in (d) comprises processing the amplitude and the anglecomputed in (c) to compute the distance and the direction from thedrilling well to the target well.
 5. The method of claim 4, wherein (d)comprises (i) acquiring a model that relates the amplitude of atransverse component of the magnetic flux emanating from the target welland an angle between the transverse component of the magnetic fluxemanating from the target well and a transverse component of Earth'smagnetic field to a distance and a direction between the drilling welland the target well, and (ii) processing the amplitude and the anglecomputed in (c) in combination with the model acquired in (i) todetermine at least one of the distance and the direction from thedrilling well to the target well.
 6. The method of claim 1, wherein theprocessing in (d) further comprises processing an axial component of themagnetic field vector and the magnetic quantity computed in (c) tocompute at least one of a distance and a direction from the drillingwell to the target well.
 7. The method of claim 1, wherein theprocessing in (c) further comprises: (i) processing a transversecomponent of the magnetic field vector measured in (b) to compute theamplitude of the transverse component of the magnetic field vector; (ii)processing an axial component of the magnetic field vector measured in(b) to compute the phase of the magnetic flux emanating from the targetwell; and (iii) processing the amplitude and the phase computed in (i)and (ii) to compute the amplitude of the transverse component of themagnetic flux emanating from the target well and the angle between thetransverse component of the magnetic flux emanating from the target welland the transverse component of Earth's magnetic field.
 8. The method ofclaim 7, wherein the phase of the magnetic flux emanating from a targetwell is computed in (ii) using the following mathematical equation:${\sin\left( {{\omega\; t} + \phi} \right)} = \frac{\left( {B_{z} - B_{zm}} \right)}{\sqrt{2}{\sigma\left( B_{z} \right)}}$wherein sin(ωt=ϕ) represents the phase, B_(zm) represents a mean valueof a set of axial magnetic field measurements, σ(B_(z)) represents astandard deviation of the set of axial magnetic field measurements, andB_(z) represents the axial component of the magnetic field vector. 9.The method of claim 7, wherein the amplitude of the transverse componentof the magnetic field vector is computed in (i) using at least one ofthe following mathematical equations:B _(xy)=√{square root over (B _(x) ² +B _(y) ²)}B _(xy)=√{square root over (2·σ(B _(x))·σ(B _(y)))} wherein B_(xy)represents the amplitude of the transverse component of the magneticfield vector, B_(x) and B_(y) represent the transverse component of themagnetic field vector measured in (b), σ(B_(x)) and σ(B_(y)) andrepresent standard deviations of corresponding sets of B_(x) and B_(y)measurements.
 10. The method of claim 7, wherein (iii) further comprisesprocessing the amplitude and the phase computed in (i) and (ii) suchthat the amplitude is expressed as a quadratic function of the phase tocompute the amplitude of the transverse component of the magnetic fluxemanating from the target well and the angle between the transversecomponent of the magnetic flux emanating from the target well and thetransverse component of Earth's magnetic field.
 11. The method of claim10, wherein the quadratic function is expressed mathematically asfollows:B _(xy) ² =B _(Txya) ² sin²(ωt+ϕ)−2B _(xys) B _(Txya) cos θ sin(ωt+ϕ)+B_(xye) ² wherein B_(xy) and sin(ωt+ϕ) represent the amplitude and thephase computed in (i), represents the amplitude of the transversecomponent of the magnetic flux emanating from the target well, θrepresents the angle between the transverse component of the magneticflux emanating from the target well and the transverse component ofEarth's magnetic field, and B_(xye) represents the transverse componentof Earth's magnetic field.
 12. The method of claim 1, wherein (c)further comprises processing the magnetic field vector measured in (b)to compute the transverse component of Earth's magnetic field.
 13. Themethod of claim 1, wherein the direction from the drilling well to thetarget well is a toolface to target angle computed using the followingmathematical equation:TFT=θ+(T−M) wherein TFT represents the toolface to target angle, θrepresents the angle computed in (c), and (T−M) represents a toolfaceoffset in which T represents a gravity toolface and M represents amagnetic toolface.
 14. A method for magnetic ranging comprising: (a)rotating a downhole drilling tool in a drilling well in sensory range ofmagnetic flux emanating from a target well having an AC magnetic sourcedeployed therein, the downhole drilling tool including a magnetic fieldsensor rotatably coupled to the downhole drilling tool; (b) causingmagnetic field sensor to measure a magnetic field vector while rotatingin (a); (c) processing the magnetic field vector measured in (b) tocompute a difference between an instantaneous rotation rate and anaverage rotation rate of the downhole drilling tool; and (d) processingthe difference computed in (c) to compute a direction from the drillingwell to the target well.
 15. The method of claim 14, wherein themagnetic field sensor comprises a tri-axial set of magnetometers and thedownhole drilling tool further comprises a tri-axial set ofaccelerometers.
 16. The method of claim 14, wherein the differencecomputed in (c) is transmitted to a surface location and the processingin (d) is performed at the surface location.
 17. The method of claim 14,wherein the processing in (d) comprises processing a sign of thedifference computed in (c) to compute the direction from the drillingwell to the target well.
 18. The method of claim 14, wherein (d) furthercomprises processing the difference computed in (c) to compute adistance and a direction from the drilling well to the target well. 19.The method of claim 18, wherein (d) further comprises (i) acquiring amodel that relates an amplitude of the difference computed in (c) to thedistance from the drilling well to the target well, and (ii) processingthe amplitude in combination with the model acquired in (i) to determinethe distance from the drilling well to the target well.
 20. The methodof claim 14, wherein the difference Δrpm is processed in (d) using thefollowing mathematical equation${\Delta\;{rpm}} \approx {{{- \frac{60}{\left( {2\;\pi} \right)}} \cdot \frac{{B_{Txya} \cdot \sin}\;\theta}{B_{exy}}}\omega\;{\cos\left( {{\omega\; t} + \phi} \right)}}$wherein B_(Txya) represents the amplitude of the transverse component ofthe magnetic flux emanating from the target well, θ represents the anglebetween the transverse component of the magnetic flux emanating from thetarget well, the transverse component of Earth's magnetic field, andB_(xys) represents the transverse component of Earth's magnetic field,and ω represents a frequency of the AC magnetic source.
 21. A method formagnetic ranging comprising: (a) rotating a downhole drilling tool in adrilling well in sensory range of magnetic flux emanating from a targetwell having an AC magnetic source deployed therein, the downholedrilling tool including a magnetic field sensor rotatably coupled to thedownhole drilling tool; (b) causing the magnetic field sensor to measurea magnetic field vector while rotating in (a); and (c) processing themagnetic field vector measured in (b) to compute at least one of adistance and a direction from a drilling well to a target well, whereinthe processing in (c) comprises (i) processing the magnetic field vectormeasured in (b) to compute an amplitude of a transverse component of themagnetic field vector and (ii) processing the amplitude to compute thedistance from the drilling well to the target well, and wherein theamplitude of the transverse component of the magnetic field vector iscomputed in (i) using at least one of the following mathematicalequations:B _(xy)=√{square root over ((B _(x) ² +B _(y) ²))}B _(xy)=√{square root over (2·σ(B _(x))·σ(B _(y)))} wherein B_(xy)represents the amplitude of the transverse component of the magneticfield vector, B_(x) and B_(y) represent the transverse component of themagnetic field vector measured in (b), and σ(B_(x)) and σ(B_(y))represent standard deviations of corresponding sets of B_(x) and B_(y)measurements.
 22. A method for magnetic ranging comprising: (a)deploying a magnetic field sensor in sensory range of magnetic fluxemanating from a ferromagnetic casing string having an AC magneticsource deployed therein; (b) causing the magnetic field sensor tomeasure an AC magnetic field emanating from the casing string; (c)processing the magnetic field measured in (b) to compute an amplitude ofat least one higher order harmonic; and (d) energizing the AC magneticsource with a non-sinusoidal input electrical current to reduce theamplitude of the higher order harmonic.
 23. The method of claim 22,wherein the ferromagnetic casing string and the AC magnetic source aredeployed in a target well and the magnetic field sensor is deployed in adrilling well.
 24. The method of claim 23, wherein the magnetic fieldsensor is rotating in the drilling well when the AC magnetic field ismeasured in (b).